home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
89xx
/
8903a.d64
/
demo5 - bw5_1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
2KB
|
53 lines
5 KX=4.8:KY=5.76:MN=2.5
6 LINE=49152:HARDCOPY=49155:CLEAR=49158
7 SYS CLEAR
10 DEFFNARC(X)=-ATN(X/SQR(1-X^2))+(null)/2
20 BW=180/(null)
30 CW=FNARC((4^2+5^2-3^2)/(2*5*4))*BW
50 DIM X1(50),Y1(50),X2(50),Y2(50),W(50),AB(50)
60 SYS LINE,1,192*KX-1,113*KY,192*KX-1,158*KY
70 SYS LINE,1,150*KX,113*KY,150*KX,158*KY
80 SYS LINE,1,192*KX-1,113*KY,150*KX,113*KY
90 SYS LINE,1,192*KX-1,158*KY,150*KX,158*KY
100 A=1
110 X1(1)=113:Y1(1)=50
120 X2(1)=158:Y2(1)=50
130 W(1)=90-CW:AB(1)=1
200 REM BERECHNEN DER DREIECKSSEITEN
210 SA=SQR( (X1(A)-X2(A))^2+(Y1(A)-Y2(A))^2 )
220 SB=SA/5 *4
230 SC=SA/5 *3
250 REM BERECHNEN DES 3. PUNKTES DES DREIECKS
260 DX=COS( W(A)/BW ) * SC
270 DY=SIN( W(A)/BW ) * SC
280 X3=X1(A)+DX
290 Y3=Y1(A)+DY
300 SYS LINE,1,(200-Y1(A))*KX-1,X1(A)*KY,(200-Y3)*KX-1,X3*KY
310 SYS LINE,1,(200-Y2(A))*KX-1,X2(A)*KY,(200-Y3)*KX-1,X3*KY
400 REM QUADRATE UEBER KATHETEN ZEICHNEN
410 Q1=X1(A)-DY : Q2=Y1(A)+DX
420 Q3=X3-DY : Q4=Y3+DX
425 :
430 X1(A+1)=Q1 : Y1(A+1)=Q2
440 X2(A+1)=Q3 : Y2(A+1)=Q4
445 W(A+1)=W(A)+ (90-CW):AB(A+1)=AB(A)+1
450 SYS LINE,1,(200-Y3)*KX-1,X3*KY,(200-Q4)*KX-1,Q3*KY
460 SYS LINE,1,(200-Q4)*KX-1,Q3*KY,(200-Q2)*KX-1,Q1*KY
470 SYS LINE,1,(200-Q2)*KX-1,Q1*KY,(200-Y1(A))*KX-1,X1(A)*KY
500 :
510 Q1=X3+(Y3-Y2(A)) : Q2=Y3+(X2(A)-X3)
520 Q3=X2(A)+(Y3-Y2(A)) : Q4=Y2(A)+(X2(A)-X3)
525 :
530 X1(A)=Q1 : Y1(A)=Q2
540 REMX2(A)=Q3 : Y2(A)=Q4
550 W(A)=W(A)- CW:AB(A)=AB(A)+1
560 SYS LINE,1,(200-Y3)*KX-1,X3*KY,(200-Q2)*KX,Q1*KY
570 SYS LINE,1,(200-Q2)*KX,Q1*KY,(200-Q4)*KX-1,Q3*KY
580 SYS LINE,1,(200-Q4)*KX-1,Q3*KY,(200-Y2(A))*KX-1,X2(A)*KY
590 X2(A)=Q3 : Y2(A)=Q4
595 IF SC<MN AND A=1 THEN 1000
600 IF SC<MN THEN A=A-1:GOTO 200
610 A=A+1:GOTO200
1000 REM
1010 SYS HARDCOPY,1850